import Vue from 'vue';
import Router from 'vue-router';
import User from './components/views/User.vue';
import Feedback from './components/views/feedback.vue';
import Find from './components/views/find.vue';
import Orders from './components/views/orders.vue';
import Goods from './components/views/goods.vue';



Vue.use(Router);

const routes = [

  {
    path: '/user',
    name: 'User',
    component: User,
    meta: { requiresAuth: true } // 需要登录才能访问
  },{
    path: '/feedback',
    name: 'feedback',
    component: Feedback,
    meta: { requiresAuth: true } // 需要登录才能访问
  },{
    path: '/find',
    name: 'find',
    component: Find,
    meta: { requiresAuth: true } // 需要登录才能访问
  },{
    path: '/orders',
    name: 'orders',
    component: Orders,
    meta: { requiresAuth: true } // 需要登录才能访问
  },{
    path: '/goods',
    name: 'goods',
    component: Goods,
    meta: { requiresAuth: true } // 需要登录才能访问
  },

];

const router = new Router({
  routes
});

// 全局路由守卫，用于判断登录状态并决定是否允许访问页面


export default router;
